﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chromos.ActionEngine;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace Chromos.Actors
{
	public class IceBullet : Projectile
	{
		public IceBullet(Game1 game, Vector2 position, Vector2 velocity, ContentManager content, bool isStatic, Actor firingActor, float seekPercentage, List<Actor> targets)
			: base(game, position, velocity, content, isStatic, firingActor, seekPercentage, targets)
		{
			this.applyGravity = false;
			boundingInflate = new Vector2(-5, -5);
			updateBoundingBox(true);
		}

		protected override void initActorFields()
		{
			this.mass = 1;
			this.health = 1;
		}

		protected override void initProjectileFields()
		{
			this.power = 10;
		}

		public override void addActions()
		{
			// Idle
			IdleAction idle = new IdleAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50);
			idle.addImageToLoad(@"Sprites/Enemies/WhiteUnits/SnowMan/Attacks/Snow");

			// Left
			VisualLoopingAction m1 = new VisualLoopingAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50);
			m1.addImageToLoad(@"Sprites/Enemies/WhiteUnits/SnowMan/Attacks/Snow");

			// Right
			VisualLoopingAction m2 = new VisualLoopingAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50);
			m2.addImageToLoad(@"Sprites/Enemies/WhiteUnits/SnowMan/Attacks/Snow");

			// Death
			DeathAction death = new DeathAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50);
			death.addImageToLoad(@"Sprites/Enemies/WhiteUnits/SnowMan/Attacks/Snow");

			actionEngine.addIdle(idle);
			actionEngine.addMovement(m1);
			actionEngine.addMovement(m2);
			actionEngine.addDeath(death);

			/*if(velocity.X > 0)
				actionEngine.playAction(ActionType.Movement, 1);
			else
				actionEngine.playAction(ActionType.Movement, 0);*/
		}
	}
}